//
//  DealTool.h
//  小团购
//
//  Created by 樊荣海 on 15/1/30.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Singleton.h"
#import "DPAPI.h"
#import "DBTool.h"
#import "DealModel.h"

@interface DealTool : NSObject <DPRequestDelegate>

typedef void (^DealsSuccessBlock) (NSArray *modelArray);
typedef void (^DealsFailBlock) (NSError *error);

// deals里面装的都是模型数据
typedef void (^DealSuccessBlock)(DealModel *deal);
typedef void (^DealFailBlock)(NSError *error);


//2个综合
typedef void(^RequestBlock) (id result, NSError *aError);





singleton_interface(DealTool)

// http://api.dianping.com/v1/deal/find_deals?city=上海&region=黄浦区&category=电影&limit=1&page=1&appkey=[appkey]&sign=[signature]

- (void)dealToolWithPage:(int)page success:(DealsSuccessBlock)successBlock fail:(DealsFailBlock)failBlock;

- (void)dealToolWithDeal_ID:(NSString *)ID success:(DealSuccessBlock)successBlock fail:(DealFailBlock)failBlock;
@end
